import { UploadApi } from "@/api/interface/upload"
import http from "@/api"
import { UniCloudParams } from '@/api/interface'

/**
 * @name 文件上传模块
 */
// 图片上传
export const uploadImg = (params: FormData) => {
  return http.post<UploadApi.ResFileUrl>(`/geeker/file/upload/img`, params)
}

// 视频上传
export const uploadVideo = (params: FormData) => {
  return http.post<UploadApi.ResFileUrl>(`/geeker/file/upload/video`, params)
}

interface UploadUniCloudFileParams {
  fileName: string
  base64: string
}
// 图片上传
export const uploadUniCloudFileApi = (
  params: UniCloudParams<UploadUniCloudFileParams>
) => {
  return http.post<UploadApi.ResFileUrl>(`/mo-admin/uploadFileUrl`, params)
}